<template>
  <div class="app-container">
    <div class="table-container" style="margin-bottom: 20px;">
      <div>
        <el-tabs v-model="tab_type" type="card" @tab-click="change_type">
          <el-tab-pane label="单页管理" name="1"></el-tab-pane>
          <el-tab-pane label="用户设置" name="2"></el-tab-pane>
        </el-tabs>
      </div>
    </div>
    <div class="info">当前用户有{{totals}}个</div>
    <!-- <el-form label-width="110px" :label-position="`top`">
      <el-form-item>
        <el-input size="small" placeholder="填写生成用户个数" v-model="userNumber" style="width:200px;margin-right: 20px;"></el-input>
      </el-form-item>
    </el-form> -->
    <div class="dialog-footer">
      <el-button size="small" type="primary" style="margin-top: 10px" :loading="isListLoading" @click="getUserList">{{isListLoading? '获取中' : '获取用户'}}</el-button>
    </div>
  </div>
</template>
<script>
import mixinsTable from '@/utils/mixins.table';
import Upload from '@/components/Upload';
export default {
  name: 'othenrUser',
  mixins: [mixinsTable],
  data() {
    return {
      tab_type: '2',
      totals: '0',
      userNumber: '',
      isListLoading: false
    };
  },
  components: {
    Upload
  },
  created() {
    // this.getUserList();
  },
  methods: {
    change_type(data, type) {
      this.$router.push({
        path: this.tab_type === '1' ? '/pages' : '/usersetup',
        query: {
          time: +new Date()
        }
      });
    },
    // 获取用户列表
    getUserList() {
      this.isListLoading = true;
      this.$API.getUserList().then((res) => {
        this.totals = res.data.total;
        this.callListLoading = false;
      }).catch((err) => {
        if (err) {
          this.callListLoading = false;
        }
      });
    },
    submitInfo(val) {
    }
  }
};

</script>
<style lang="scss" scoped>
.info{
  padding: 0 0 15px 0;
  font-size:14px;
  color:#666;
}
</style>
